import request from '@/utils/request'

// 从环境变量中获取域名  @TODO 根据实际更改
const domain = 'http://localhost:7001'

export function addObj(data) {
  return request({
    url: `${domain}/$TABLENAME$/add`,
    method: 'post',
    data
  })
}

export function updateObj(data) {
  return request({
    url: `${domain}/$TABLENAME$/update`,
    method: 'post',
    data
  })
}

export function listObjs(params) {
  return request({
    url: `${domain}/$TABLENAME$/list`,
    method: 'get',
    params
  })
}

export function getObj($PRIMARYKEY$) {
  return request({
    url: `${domain}/$TABLENAME$/get`,
    method: 'get',
    params: { $PRIMARYKEY$ }
  })
}



export function deleteObj($PRIMARYKEY$) {
  return request({
    url: `${domain}/$TABLENAME$/delete`,
    method: 'get',
    params: { $PRIMARYKEY$ }
  })
}
